#ifndef TASK_THREAD_H
#define TASK_THREAD_H

#include <pthread.h>
#include <unistd.h>
#include <sys/syscall.h>

namespace Thread{
    extern __thread pid_t tid;

    void cacheTid();

    inline pid_t getTid(){
        if (tid == 0) cacheTid();
        return tid;
    }
}

#endif //TASK_THREAD_H
